/**
 * 
 */
package traj.core;

import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

/**
 * 
 * @author Xiaohui Li
 * 
 *        Base class of trajectories
 */
public class ITrajectory {

	int tid ;
	Vector<TPoint> points;
	
	public ITrajectory() {
		points = new Vector<TPoint>();
	}
	public ITrajectory(int tid) {
		points = new Vector<TPoint>();
		this.tid = tid;
	}
	public ITrajectory(Vector<TPoint> t_points) {
		points = t_points;
	}

	public void append(TPoint aPoint) {
		points.add(aPoint);
	}

	public String buildTSequence() {
		String str = "";
		for (TPoint p : points) {
			str += p.rid+" ";
		}
		return str;
	}
	
	public List<Long> buildTSeqLong() {
		ArrayList<Long> list = new ArrayList<Long>(points.size());
		for (TPoint p : points) {
			list.add(p.rid);
		}
		return list;
	}
	public void setId(int oid) {
		tid = oid;
	}

}
